package com.surenpi.jenkins.client;

import com.surenpi.jenkins.client.plugin.Plugins;
import java.io.IOException;

public abstract class BaseManager {
   private JenkinsClient client;
   private boolean crumb = true;

   protected JenkinsClient getClient() {
      return this.client;
   }

   public void setClient(JenkinsClient client) {
      this.client = client;
   }

   public boolean isCrumb() {
      return this.crumb;
   }

   public void setCrumb(boolean crumb) {
      this.crumb = crumb;
   }

   protected abstract String[] getDependencyArray();

   public boolean dependencyCheck() throws IOException {
      Plugins plugins = new Plugins();
      plugins.setClient(this.getClient());
      return plugins.pluginsExists(this.getDependencyArray());
   }
}
